﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BinsinessDo.ascx.cs" Inherits="Thksoft.UserCotrols.BinsinessDo" %>

<link href="/CSS/Main.css" rel="stylesheet" type="text/css" />

<asp:HiddenField ID="HIds" runat="server" />

<div class="main_show_content">

    <table border="0" width="99%" cellpadding="0" cellspacing="0" class="table">
        <tr>

            <td style="width: 120px" class="nolefttd">业务名称：
            </td>

            <td class="norighttd" colspan="3">
                <asp:Label ID="Label3" runat="server"></asp:Label>
            </td>

            <td style="width: 120px" class="nolefttd">业务编号：
            </td>

            <td class="norighttd" colspan="3">
                <asp:Label ID="Label2" runat="server"></asp:Label>
            </td>
        </tr>

        <tr>
            <td style="width: 120px" class="nolefttd">当前节点：
            </td>
            <td class="norighttd">
                <asp:Label ID="lblCurrentNode" runat="server"></asp:Label>
            </td>
            <td style="width: 80px" class="nolefttd">转交条件：
            </td>
            <td class="norighttd">
                <asp:DropDownList ID="ddlConditions" runat="server" Width="200px" OnSelectedIndexChanged="ddlConditionsl_SelectedIndexChanged"
                    AutoPostBack="true">
                </asp:DropDownList>
            </td>
            <td class="nolefttd">工作人员：
            </td>
            <td colspan="3" class="norighttd">
                <asp:Label ID="lblWorkUser" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="nolefttd">下一办理节点：
            </td>

            <td class="norighttd" colspan="3">
                <asp:Label ID="lblNextNode" runat="server"></asp:Label>
            </td>

            <td class="nolefttd">下一办理人：
            </td>

            <td colspan="3" class="norighttd">
                <asp:Label ID="lblNextBlr" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="nolefttd">办理类型：
            </td>
            <td class="norighttd">

                <asp:RadioButtonList ID="radbllx" runat="server" RepeatDirection="Horizontal" AutoPostBack="true"
                    OnSelectedIndexChanged="radbllx_SelectedIndexChanged">
                    <asp:ListItem Value="0" Selected="True">常规办理</asp:ListItem>
                    <asp:ListItem Value="1">特殊流转</asp:ListItem>
                </asp:RadioButtonList>
            </td>
            <td class="nolefttd">常用批示：
            </td>
            <td colspan="5" class="norighttd">
                <asp:DropDownList ID="ddlReplySelect" runat="server" onchange="Reply()" Width="150px">
                </asp:DropDownList>
            </td>
        </tr>

        <tr id="tr3" runat="server">
            <td class="nolefttd">下一步审核人：
            </td>
            <td class="norighttd" colspan="7">

                <font style="color: Red">*</font>
                <input runat="server" id="namesx" type="text" class="txtbox" style="width: 350px" onclick="OpenUser()" />
                <asp:HiddenField ID="hidsx" runat="server" />
            </td>
        </tr>

        <tr id="tr1" runat="server">
            <td class="nolefttd">特殊流转：
            </td>
            <td class="norighttd">
                <asp:DropDownList ID="ddlht" runat="server" Width="150px"
                    OnSelectedIndexChanged="ddlht_SelectedIndexChanged" AutoPostBack="true">
                </asp:DropDownList>
            </td>
            <td colspan="6" class="norighttd">
                <asp:RadioButtonList ID="radtz" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="0" Selected="True">逐步重走</asp:ListItem>
                    <asp:ListItem Value="1">一步重走</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td class="nolefttd">办理意见：
            </td>
            <td colspan="6" class="norighttd">
                <asp:TextBox ID="txt_TransactAttitude" runat="server" Width="85%" Height="50px" TextMode="multiLine"
                    MaxLength="1000"></asp:TextBox>
                <asp:Label ID="Label1" runat="server" Text="*" Style="color: Red"></asp:Label>
                <%--    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="不能为空"
                        ControlToValidate="txt_TransactAttitude"></asp:RequiredFieldValidator>--%>
            </td>
            <td>
                <asp:Image ID="img_Signature" runat="server" ImageUrl="~/images/white.bmp" Height="26px"
                    Width="68px" />
            </td>
        </tr>

        <tr>
            <td colspan="8" class="norighttd" style="height: 40px;">

                <asp:Button ID="btnsave" runat="server" CssClass="bt_css_s" Text="提  交" OnClientClick="window.event.returnValue=isnull();" OnClick="btnsave_Click" />

                <asp:Button ID="btnzx" runat="server" CssClass="bt_css_s" Text="业务注销" OnClientClick="window.event.returnValue= isnullzs();" OnClick="btnzx_Click" />

                <input type="button" id="btnSubmit" value="返回待办" class="bt_css_s" onclick="ReturnDo()" />

                <asp:HiddenField ID="hfd_SignatureID" runat="server" Value="0" />
                <asp:HiddenField ID="HiddenField1" runat="server" />
            </td>
        </tr>
    </table>
</div>

<script type="text/javascript">

    function ReturnDo() {
        location.href = '../../Right.aspx';
    }
    function Reply() {
        var va = document.getElementById("<%=ddlReplySelect.ClientID %>").value;
        if (va != "--请选择--") {
            document.getElementById("<%=txt_TransactAttitude.ClientID %>").value = va;
        }
    }
    function showSignature() {
        var today = new Date(); //获得当前时间
        // var ss =today.getSeconds();
        var ss = today.getTime();
        var signatureID = window.showModalDialog("../WorkManager/SelectSignature.aspx?data=" + ss, "", "dialogHeight:400px; dialogWidth:450px;");
        //谷歌兼容
        if (signatureID == undefined) {
            signatureID = window.returnValue;
        }
        if (signatureID != "0" && signatureID != null) {
            var v = /^\d+(\.\d+)?$/;
            if (signatureID.match(v)) {
                document.getElementById("<%=hfd_SignatureID.ClientID %>").value = signatureID;
                document.getElementById("<%=img_Signature.ClientID %>").src = "../WorkManager/SignatureImage.aspx?SignatureID=" + signatureID;
                document.getElementById("<%=HiddenField1.ClientID %>").value = document.getElementById("<%=img_Signature.ClientID %>").src

            }
            return true;
        }
        return false;
    }
    function isnullzs() {
        var qz = document.getElementById("<%=hfd_SignatureID.ClientID %>");
        var exesname = document.getElementById("<%=txt_TransactAttitude.ClientID %>");
        if (exesname.value.replace(/[(^\s*)|(\s*$)]/g, "") == "") {
            alert("【系统提示】请选择或填写办理意见");
            document.getElementById('<%=txt_TransactAttitude.ClientID%>').focus();
            return false;
        }

        if (confirm('确定注销当前流程吗?')) {
            return true;
        }
        else {
            return false;
        }

//        if (qz.value == "0") {
//            return showSignature();
//        }

       // return true;
    }
    function isnull() {

        var zpx = document.getElementById("<%=tr3.ClientID %>").style.display;
        // alert(zpx);
        if (zpx == "table-row") {
            if (document.getElementById("<%=hidsx.ClientID %>").value == "") {
                alert("【系统提示】请选择下一步审核人！");
                return false;
            }
        }

      //  var qz = document.getElementById("<%=hfd_SignatureID.ClientID %>");
        var exesname = document.getElementById("<%=txt_TransactAttitude.ClientID %>");
        if (exesname.value.replace(/[(^\s*)|(\s*$)]/g, "") == "") {
            alert("【系统提示】请选择或填写办理意见");
            document.getElementById('<%=txt_TransactAttitude.ClientID%>').focus();
            return false;
        }

        if (confirm('确定流转到下一步吗?')) {
            return true;
        }
        else {
            return false;
        }

//        if (qz.value == "0") {
//            return showSignature();
//        }

        return true;
    }
    function Jump() {
        var ral = document.getElementById("<%=radbllx.ClientID %>").value;
        alert(ral);
        if (ral == "1") {
            document.getElementById("tr1").style.display = "block";
        }
        else {
            document.getElementById("tr1").style.display = "none";
        }
    }
    function OpenUser() {
        top.MessageBox.OpenUser({ TextID: '<%=this.namesx.ClientID %>', ValueID: '<%=this.hidsx.ClientID %>', Window: window, Value: '?mode=1' })
    }
    function Show1(type, bools) {
        var today = new Date(); //获得当前时间
        var ss = today.getSeconds() < 10 ? "0" + today.getSeconds() : today.getSeconds();
        var returnval;
        if (type == "0") {
            //top.MessageBox.OpenUser({Window:window,TextID:""});
            returnval = window.showModalDialog("../PublicShow/SelectUser.aspx?data=" + ss + "&mode=" + bools, window, "dialogHeight:550px;dialogWidth:550px;status:no;");

        } else {
            returnval = window.showModalDialog("../PublicShow/SelectDept.aspx?data=" + ss + "&type=" + type + "&mode=" + bools, window, "dialogHeight:550px;dialogWidth:550px;status:no;");
        }
        //谷歌浏览器兼容
        if (returnval == undefined) {
            returnval = window.returnValue;
        }
        if (returnval != undefined) {
            var str = returnval;
            var list = str.split('|');
            var mh = document.getElementById("<%=hidsx.ClientID %>");
            var ru = document.getElementById("<%=namesx.ClientID %>");
            if (mh != null && mh != undefined) {
                document.getElementById("<%=hidsx.ClientID %>").value = list[0];
            }
            if (ru != null && ru != undefined) {
                document.getElementById("<%=namesx.ClientID %>").value = list[1];
            }
        }
    }
</script>